import request from '@/utils/request'

// 商品分类--增删改查
export function queryGoodsCate(query) {
  return request({
    url: '/goods/classify/list',
    method: 'get',
    params: query
  })
}
export function addGoodsCate (query) {
  return request({
    url: '/goods/classify',
    method: 'post',
    data: query
  })
}
export function updateGoodsCate (query) {
  return request({
    url: '/goods/classify',
    method: 'put',
    data: query
  })
}
export function delGoodsCate (id) {
  return request({
    url: `/goods/classify/${id}`,
    method:'delete'
  })
}

// 规格参数--增删改查
export function queryGoodsAttr(query) {
  return request({
    url: '/goods/attribute/list',
    method: 'get',
    params: query
  })
}
export function addGoodsAttr (query) {
  return request({
    url: '/goods/attribute',
    method: 'post',
    data: query
  })
}
export function updateGoodsAttr (query) {
  return request({
    url: '/goods/attribute',
    method: 'put',
    data: query
  })
}
export function delGoodsAttr (id) {
  return request({
    url: `/goods/attribute/${id}`,
    method:'delete'
  })
}

// 商品--添删改查
export function queryGood(query) {
  return request({
    url: '/goods/goods/list',
    method: 'get',
    params: query
  })
}
export function addGood(query) {
  return request({
    url: '/goods/goods',
    method: 'post',
    data: query
  })
}
export function updateGood(query) {
  return request({
    url: '/goods/goods',
    method: 'put',
    data: query
  })
}
export function delGood(id) {
  return request({
    url: `/goods/goods/${id}`,
    method:'delete'
  })
}

// 查询商品详情信息
export function queryGoodInfo(id) {
  return request({
    url: `/goods/goods/${id}`,
    method: 'get',
  })
}
